#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int findMaxConsecutiveOnes(int* nums, int numsSize) {
    int max = 0;
    int again = 0;
    while (again != numsSize)
    {
        int count = 0;
        int i = again;
        for (; i < numsSize; i++)
        {
            if (nums[i] == 1)
            {
                count++;
            }
            if (count > max)
            {
                max = count;
            }
            if (nums[i] != 1)
            {
                break;
            }
        }
        if (i == numsSize)
            break;
        again++;
    }
    return max;
}

int main()
{
    int arr[] = { 1,1,0,1,1,1 };
    int sz = sizeof(arr) / sizeof(arr[0]);
    int print = findMaxConsecutiveOnes(arr, sz);
    printf("%d", print);
    return 0;
}